<template>
  <config-provider :locale="zhCN" :theme="{ token: themeToken }">
    <router-view />
  </config-provider>
</template>

<script setup lang="ts">
import { ConfigProvider } from 'ant-design-vue'
import zhCN from 'ant-design-vue/es/locale/zh_CN'

// 获取当前的主题色值
const getThemeColor = ()=> {
  const rootStyle = getComputedStyle(document.documentElement);
  return rootStyle.getPropertyValue('--theme-color').trim(); // .trim() 去掉空格
}

/** 主题 */
const themeToken = {
  borderRadius: 2,
  colorInfo: getThemeColor(),
  colorTextBase: '#333333',
  colorPrimary: getThemeColor(),
}
</script>
<style lang="less">

</style>
